pass messages laravel

31

return Redirect::to('users/register')->with('message', 'The following errors occurred')->withErrors($validator)->withInput();

Further, you can print them as:

@if(Session::has('message'))
      <p class="alert">{!! Session::get('message') !!}</p>
      @foreach($errors->all() as $error)
          <p>{!! $error !!}</p>
      @endforeach
@endif

Comments

Submit
0 Comments